-
Notifications
You must be signed in to change notification settings - Fork 8.3k
soc: st: stm32: h7rsxx: Fix MPU region for read-only id flash region #99745
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
soc: st: stm32: h7rsxx: Fix MPU region for read-only id flash region #99745
Conversation
djiatsaf-st
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
I guess we'll need more of those soon, that would be useful. |
it's called IO for a reason |
Do you plan to do it ? |
I can, any suggestions for a good name? |
I'm not sure if this has a lot of value considering that
(i.e., do we really care about the region being read-only?) |
Set correct MPU memory type and size for the uniqe device id, package code and ADC VREF/TS calibration read-only flash region. REGION_IO_ATTR configures the MPU region to device-memory with RW access, which is also used for the PERIPH region. To avoid complicating things unnecessarily, we use this type instead of defining a new device-RO. The size is reduced to 512 bytes, because RM0477 table 28 and chapter 5.3.12 state that this read-only flash area has a size of 512 bytes. Signed-off-by: Thomas Decker <[email protected]>
392c1f4 to
557d1a3
Compare
Good point. Changed the region type to |
|



Set correct MPU memory type and size for the uniqe device id, package code and ADC VREF/TS calibration read-only flash region.
(DEVICE_NON_SHAREABLE | REGION_512B | P_RO_U_NA_Msk)) is the same as REGION_IO_ATTR (used for PERIPH region) but RO instead of RW.Edit: REGION_IO_ATTR configures the MPU region to device-memory with RW access, which is also used for the PERIPH region. To avoid complicating things unnecessarily, we use this type instead of defining a new device-RO.
The size is reduced to 512 bytes, because RM0477 table 28 and chapter 5.3.12 state that this read-only flash area has a size of 512 bytes.
I introduced this region with PR #97364, both configurations work, but it is more correct with this one.
Testing: Network still initializes with this changes (reads uniqe device ID for creating the mac address per default).
Cross-check: Will mem-fault during zephyr init when commenting out this
MPU_REGION_ENTRY.Open question: Create a
#definefor this type?REGION_IO_ATTR_ROfor example